@extends('admin.admin')

@section('content')

        <!-- Content Header (Page header) -->
<section class="content-header">
    <h1>
        <?php $orderTypeArr = ['1'=>'E贸易','2'=>'普通贸易'];?>
        {{$orderTypeArr[$order_type]}}订单管理
        <small>列表</small>
    </h1>
    <ol class="breadcrumb">
        <li><a href="/admin"><i class="fa fa-dashboard"></i> 控制面板</a></li>
        <li class="active">{{$orderTypeArr[$order_type]}}订单列表</li>
    </ol>
</section>

<!-- Main content -->
<section class="content">

    <div class="row">
        <div class="col-xs-12">

            <div class="box box-primary ">
                <div class="box-header ">
                </div>
                <div class="box-body table-responsive no-padding">

                    {!! Form::model(@$orderInfo,array('method' => 'get','class'=>'form-search')) !!}


                        <div class="col-xs-2">
                            <div class="form-group">

                                {!! Form::text('order_sn',@$_GET['order_sn'],array('class'=>'form-control ','placeholder'=>'订单号'))!!}
                            </div>
                        </div>
                        <div class="col-xs-2">
                            {!! Form::text('consignee',@$_GET['consignee'],array('class'=>'form-control','placeholder'=>'收货人'))!!}

                        </div>

                        <div class="col-xs-2">
                            {!! Form::select('order_status',$orderStatusArr,@$_GET['order_status'],['class'=>'form-control','placeholder'=>'ssss'])!!}

                        </div>

                        <div class="col-xs-6">
                            <button type="submit" class="btn btn-primary " style="margin-right:60px;">&nbsp;搜索</button>
                            <button type="reset" class="btn btn-primary " style="margin-right:60px;">&nbsp;重置</button>

                        </div>




                    {!! Form::close() !!}
                </div>




            </div><!-- end .box box-primary -->

            <div class="box box-primary">


                <div class="box-header">
                    <h3 class="box-title">{{$orderTypeArr[$order_type]}}订单列表</h3>
                    
                </div>
                <!-- /.box-header -->
                <div class="box-body table-responsive no-padding">
                    <table class="table table-hover">
                        <tr>
                            <th>子订单编号</th>
                            <th>用户</th>
                            <th>下单时间</th>
                            <th>订单价格</th>
                            <th>订单状态</th>
                            <th style="width: 150px;">操作</th>

                        </tr>
                        @foreach ($orderInfo as $order)
                        <tr>
                            <td>{{$order->sub_order_sn}}</td>
                            <td>{{$user::find($order->user_id)->user_name}}</td>
                            <td>{{$order->add_time}}</td>
                            <td>{{$order->order_price}}</td>
                            <td>{{$orderStatusArr[$order->order_status]}}</td>
                            <td>
                                <a href="/admin/order/{{$order->order_id}}" type="button" class="btn  btn-default btn-xs">
                                    <i class="glyphicon glyphicon-eye-open"></i>&nbsp;订单详情
                                </a>
                            </td>
                        </tr>
                        @endforeach

                    </table>
                </div>
                <!-- /.box-body -->
            </div>
            <!-- /.box -->
            {!! $orderInfo->render() !!}
        </div>
    </div>
</div>


</section>
<!-- /.content -->
@endsection